package com.itheima.Array;
import java.util.Scanner;
public class SumArray {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[5];
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第"+(i+1)+"数字");
            int num = sc.nextInt();
            arr[i] = sc.nextInt();
            if(num >=50 && num <= 100){
                System.out.println("您输入的数字有误!");
                i--;
            }
            sum += arr[i];
        }
        System.out.println("sum:"+sum);
    }
}

